﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Acoris.Document
{
    public sealed class AudioSegment:DelegateElement
    {
        public AudioSegment(ResourceKey source) : base(source) { }

        public override void InsertRange(int offset, IContentSegment content)
        {
            
        }

        public override void RemoveRange(int offset, int count)
        {
           
        }

        public override void ReplaceRange(int offset, int count, IContentSegment content)
        {
           
        }

        #region Override

        /// <summary>
        /// 获取与当前对象等价的字符串形式
        /// </summary>
        /// <returns>返回与当前对象等价的字符串形式</returns>
        public override string ToString()
        {
            return "Audio";
        }

        /// <summary>
        /// 获取当前对象与指定对象之间的等价性
        /// </summary>
        /// <param name="obj">指定要比较的对象</param>
        /// <returns>如果两个对象之间等价则返回true，否则返回false</returns>
        public override bool Equals(object obj)
        {
            if (obj is AudioSegment audio) {
                return audio.SourceKey == this.SourceKey;
            }
            return false;
        }

        /// <summary>
        /// 获取当前对象的哈希值
        /// </summary>
        /// <returns>返回当前对象的哈希值</returns>
        public override int GetHashCode()
        {
            return base.GetHashCode() ^ base.SourceKey.GetHashCode();
        }

        #endregion
    }
}
